package com.iflytek.iot.quartz;

import com.iflytek.iot.common.model.BaseResult;

import java.io.Serializable;

/**
 * @author yu 2018/12/26.
 */
public class JobResult<T> extends BaseResult<T> implements Serializable{

    private static final long serialVersionUID = -3302828416606345294L;

    public static <T> JobResult<T> ok(String message) {
        return baseCreate(message, true);
    }

    public static <T> JobResult<T> fail(String message){
        return baseCreate(message,false);
    }

    private static <T> JobResult<T> baseCreate (String msg, boolean success) {
        JobResult result = new JobResult();
        result.setSuccess(success);
        result.setMessage(msg);
        return result;
    }
}
